Leo's script below, emulates the function of the 'CopyWin' function that
was available in Opus v4. See the comments at the start of the script for
the usage of it.
The script checks for existence of a SOURCE and DESTINATION lister,
if it can't find either then it exits with an error message. If both exist, then
it finds the path of the SOURCE lister and tells the DESTINATION lister to
read it in.
You could eliminate the steps where it finds the SOURCE path and reads
it into the DESTINATION lister by replacing them with the lister copy
command.
So this:
lister query source_handle.0 path
source_path = RESULT
lister read dest_handle.0 '"'||source_path||'"'
could be replaced by this:
lister copy source_handle.0 dest_handle.0
/* WinCopy for Directory Opus 5.
by Leo 'Nudel' Davidson for Gods'Gift Utilities
email: leo.davidson@keble.oxford.ac.uk www: http://users.ox.ac.uk/~kebl0364
$VER: WinCopy.dopus5 1.4 (26.12.95)
NOTE: This script _requires_ DOpus v5.11 or above.
NOTE: DOpusFuncs is an assembler version of this (and other) scripts.
NOTE: This script does *NOT* do the same thing as Gary Gagnon's
"CloneSRCE.dopus5" or "same.dopus5", read on...
This script will copy the source lister to the destination lister,
like the old CopyWin command in DOpus4.
If you wish to open a _new_ lister which is a copy of the source
one (as apposed to turning an existing lister into a copy of the
source), you should use Gary Gagnon's "CloneSRCR.dopus5" script,
which was included in the official DOpus v5.11 update as
"DOpus5:ARexx/same.dopus5". Gary's script is also able to clone
multiple source listers at once.
Call as:
------------------------------------------------------------------------------
ARexx DOpus5:ARexx/WinCopy.dopus5 {Qp}
------------------------------------------------------------------------------
Turn off all switches.
*/
options results
options failat 99
signal on syntax;signal on ioerr /* Error trapping */
parse arg DOpusPort
DOpusPort = Strip(DOpusPort,"B",'" ')
If DOpusPort="" THEN Do
Say "Not correctly called from Directory Opus 5!"
Say "Load this ARexx script into an editor for more info."
EXIT
END
If ~Show("P",DOpusPort) Then Do
Say DOpusPort "is not a valid port."
EXIT
End
Address value DOpusPort
lister query source stem source_handle.
IF source_handle.count = 0 | source_handle.count = "SOURCE_HANDLE.COUNT" Then Do
dopus request '"You must have a SOURCE lister!" OK'
EXIT
End
lister query dest stem dest_handle.
IF dest_handle.count = 0 | dest_handle.count = "DEST_HANDLE.COUNT" Then Do
dopus request '"You must have a DESTINATION lister!" OK'
EXIT
End
lister query source_handle.0 path
source_path = RESULT
lister read dest_handle.0 '"'||source_path||'"'
syntax:;ioerr: /* In case of error, jump here */
EXIT
|